package org.ehe.business.bom.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.ehe.business.bom.domain.BomMaster;
import org.ehe.business.bom.domain.BomProjectRelation;
import org.ehe.business.bom.domain.dto.BomCreationRequest;

import java.util.Date;
import java.util.List;

/**
 * @author :zhangnn
 * @className :BomProjectRelationService
 * @description: TODO
 * @date 2025-07-30 13:55:51
 */
public interface BomProjectRelationService extends IService<BomProjectRelation> {
    /**
     * 创建BOM与项目的关联关系
     * @param projectRelation
     */
    void createBomProjectRelation(BomProjectRelation projectRelation);

    /**
     * 根据BOM ID查询项目关联关系
     * @param bomId
     * @return
     */
    List<BomProjectRelation> getRelationsByBomId(Long bomId);

    /**
     * 批量设置关联关系的失效日期（项目结束时使用）
     * @param projectId
     * @param projectEndDate
     */
    void batchExpireRelationsByProject(Long projectId, Date projectEndDate);

    /**
     * 更新或插入项目关联关系
     * @param bomMaster
     * @param request
     */
    void upsertProjectRelation(BomMaster bomMaster, BomCreationRequest request);
}
